﻿using Common.Exceptions;
using Ebusiness_Authservice.Services;
using Ebusiness_Authservice.Services.Dtos;
using Microsoft.AspNetCore.Mvc;
using OpenIddict.Client;
using ProductService.Services;
using ProductService.Services.Dtos;
using Servicecomb.Saga.Omega.Abstractions.Transaction;
using Volo.Abp.Application.Dtos;
using Volo.Abp.AspNetCore.Mvc;
using Volo.Abp.ObjectMapping;
using WebSite_Aggregate.Services.Dtos;

namespace ProductService.Controllers;

[Route("ebusinessseckills/loginregistry")]
public class LoginRegistryController : AbpController
{

    public IApplicationUserService applicationUserService { get; set; }

    public LoginRegistryController()
    {

    }

    /// <summary>
    /// 注册用户接口
    /// </summary>
    /// <param name="registryUserDto"></param>
    /// <returns></returns>
    [HttpPost("RegistryUser")]
    public async Task<ApplicationUserDto> RegistryUser(RegistryUserDto registryUserDto)
    {
        ApplicationUserDto applicationUserDto = ObjectMapper.Map<RegistryUserDto, ApplicationUserDto>(registryUserDto);
        var dto = await applicationUserService.CreateAsync(applicationUserDto);
        return dto;
    }
}
